﻿import os;
import re;

# 遍历文件夹

class dirFileInfo():

	def walkFile(self,file):

		fileNames=[]

		for root, dirs, files in os.walk(file):

		    # root 表示当前正在访问的文件夹路径
		    # dirs 表示该文件夹下的子目录名list
		    # files 表示该文件夹下的文件list

		    # 遍历文件
			for f in files:

				#print(os.path.join(root, f))

				fileNames.append(os.path.join(root, f))

			# 遍历所有的文件夹
			for d in dirs:
				#print(os.path.join(root, d))
				fileNames.append(os.path.join(root, d))

		return fileNames


	def main(self):

		return self.walkFile("C:/liaotian/")

	def get_FileSize(self,filePath):
	 
		fsize = os.path.getsize(filePath)
		fsize = fsize/1024	

		return round(fsize,0)

	def getyiK(self):

		dr=self

		dirlist=[]

		for fPath in dr.main():

			# if (re.search(r'13328080082',fPath)):

			# 	print('fPath==>',fPath)

			# 	print('size==>',dr.get_FileSize(fPath))

			# 	print(re.sub(r'C:/liaotian/|\.png','',fPath))


			if dr.get_FileSize(fPath)==1:

				# print('fPath==>',fPath)

				# print('size==>',dr.get_FileSize(fPath))

				# print(re.sub(r'C:/liaotian/|\.png','',fPath))

				dirlist.append(re.sub(r'C:/liaotian/|\.png','',fPath))

		return dirlist



if __name__ == '__main__':

	
	dr=dirFileInfo()

	print(dr.getyiK())